<html>
<head><meta charset="utf-8"><title>why does miri require xargo · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html">why does miri require xargo</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214350697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350697">(Oct 23 2020 at 18:40)</a>:</h4>
<p>Why does Miri require Xargo? I looked in the README but couldn't find anything</p>



<a name="214350715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350715">(Oct 23 2020 at 18:40)</a>:</h4>
<p>Miri needs to build a custom libstd</p>



<a name="214350729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350729">(Oct 23 2020 at 18:40)</a>:</h4>
<p>it builds libstd from source to get MIR of all functions</p>



<a name="214350751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350751">(Oct 23 2020 at 18:40)</a>:</h4>
<p>additionally, there are some <code>#[cfg(miri)]</code>s in libstd</p>



<a name="214350771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350771">(Oct 23 2020 at 18:41)</a>:</h4>
<p>e.g. for the panic infrastructure</p>



<a name="214350818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350818">(Oct 23 2020 at 18:41)</a>:</h4>
<p>Why wouldn't it be able to build libstd from src using cargo?</p>



<a name="214350960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350960">(Oct 23 2020 at 18:42)</a>:</h4>
<p>That's currently experimental (behind <code>-Z build-std</code>)</p>



<a name="214350995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214350995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214350995">(Oct 23 2020 at 18:43)</a>:</h4>
<p>miri existed before <code>-Z build-std</code>, and I think <code>-Z build-std</code> might not be ready for Miri yet</p>



<a name="214351009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214351009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214351009">(Oct 23 2020 at 18:43)</a>:</h4>
<p>though I don't know if anyone's tried to move miri off xargo</p>



<a name="214351049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214351049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214351049">(Oct 23 2020 at 18:43)</a>:</h4>
<p>Yeah, it would be nice; for one because of:</p>
<blockquote>
<h1>PSA: Xargo is in maintenance mode</h1>
</blockquote>



<a name="214351239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214351239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214351239">(Oct 23 2020 at 18:45)</a>:</h4>
<p>Side note: why does Miri use <code>cargo install xargo --force</code>?</p>



<a name="214351276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214351276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214351276">(Oct 23 2020 at 18:45)</a>:</h4>
<p>I think <code>cargo install</code> used to not allow upgrading if you didn't pass <code>--force</code></p>



<a name="214351290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214351290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214351290">(Oct 23 2020 at 18:45)</a>:</h4>
<p>Ah, maybe I'll open a PR then</p>



<a name="214351376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214351376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214351376">(Oct 23 2020 at 18:46)</a>:</h4>
<p>Thanks for explaining btw!</p>



<a name="214417808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214417808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214417808">(Oct 24 2020 at 09:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307537">Camelid</span> <a href="#narrow/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo/near/214351049">said</a>:</p>
<blockquote>
<p>Yeah, it would be nice; for one because of:</p>
<blockquote>
<h1>PSA: Xargo is in maintenance mode</h1>
</blockquote>
</blockquote>
<p>This note basically means that I am maintaining xargo just enough to keep miri working :)</p>



<a name="214417866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214417866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214417866">(Oct 24 2020 at 09:32)</a>:</h4>
<p>but yes, it would be nice to move to <code>-Zbuild-std</code> at some point. the design goals are a bit different though; build-std only aims at building a std for a particular crate, whereas miri needs to be able to build a sysroot.</p>



<a name="214428217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214428217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214428217">(Oct 24 2020 at 13:35)</a>:</h4>
<p>What's the difference?</p>



<a name="214433882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214433882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214433882">(Oct 24 2020 at 15:40)</a>:</h4>
<p>Miri currently builds a single global sysroot, and uses it whenever you run <code>cargo miri</code></p>



<a name="214433893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214433893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214433893">(Oct 24 2020 at 15:40)</a>:</h4>
<p>With <code>-Z build-std</code> (as currently implemented), I think this would need to be done for every crate you run miri with</p>



<a name="214435893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214435893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214435893">(Oct 24 2020 at 16:23)</a>:</h4>
<p>Ah ok, caching is the difference. Yeah I've often wished cargo would have a global cache and clean it up itself - right now I use <code>CARGO_TARGET_DIR</code> and run <code>cargo clean</code> every six weeks but it would be nice to have it built-in</p>



<a name="214438381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214438381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214438381">(Oct 24 2020 at 17:10)</a>:</h4>
<p>At least it's better than <code>pip</code> :)</p>



<a name="214438402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214438402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214438402">(Oct 24 2020 at 17:11)</a>:</h4>
<p>(<code>pip</code>'s default is install globally, <code>cargo</code>'s default is install locally)</p>



<a name="214478012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/why%20does%20miri%20require%20xargo/near/214478012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo.html#214478012">(Oct 25 2020 at 08:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/131828-t-compiler/topic/why.20does.20miri.20require.20xargo/near/214435893">said</a>:</p>
<blockquote>
<p>Ah ok, caching is the difference. Yeah I've often wished cargo would have a global cache and clean it up itself - right now I use <code>CARGO_TARGET_DIR</code> and run <code>cargo clean</code> every six weeks but it would be nice to have it built-in</p>
</blockquote>
<p>it's a bit more than just caching... for example, it's about building a single stdlib that is able to serve both <code>panic=unwind</code> and <code>panic=abort</code> applications</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>